package getWay

import (
	"github.com/gin-gonic/gin"
)

const (
	headerKeyToken      = "token"
	headerKeyPlatform   = "platform"
	headerKeyAppId      = "appId"
	headerKeyTimeStamp  = "timeStamp"
	headerKeySign       = "sign"
	headerKeySourceType = "sourceType"
	headerKeyVersion    = "version"
)

const headerKeyClientSource = "clientSource"

func GetToken(c *gin.Context) string {
	return c.GetHeader(headerKeyToken)
}

func SetToken(v string, c *gin.Context) {
	c.Header(headerKeyToken, v)
}

func GetAppId(c *gin.Context) string {
	return c.GetHeader(headerKeyAppId)
}

func GetTimeStamp(c *gin.Context) string {
	return c.GetHeader(headerKeyTimeStamp)
}

func GetSign(c *gin.Context) string {
	return c.GetHeader(headerKeySign)
}

func GetPlatform(c *gin.Context) string {
	platformCode := c.GetHeader(headerKeyPlatform)
	return platformCode
}

func GetSourceType(c *gin.Context) string {
	hv := c.GetHeader(headerKeySourceType)
	return hv
}

func GetVersion(c *gin.Context) string {
	hv := c.GetHeader(headerKeyVersion)
	return hv
}
